#!/usr/bin/env python
#coding=utf-8
#Version:1.0.0


man = []
other = []
try:
	data = open("sketch.txt")
	for each_line in data:
		try:
			(role,line_spoken) = each_line.split(':',1)
			line_spoken = line_spoken.strip()
			if role == 'Man':
				man.append(line_spoken)
			elif role == 'Other Man':
				other.append(line_spoken)
		except ValueError:
			pass
	data.close()
except IOError:
	print("The datafile is missing!")
try:
	man_file = open('man_data.txt','w')
	other_file = open('other_data.txt','w')
	man_file.write(str(man))
	other_file.write(str(other))
except IOError as err:
	print('File Error!' + str(err))
finally:
	if 'man_file' in locals():
		man_file.close()
	if 'other_file' in locals():
		other_file.close()
